<template>
  <div>
    <div
      class="list-item"
      v-for="(item,index) of list"
      :key="index">
      <div class="item-title">
        <span class="item-title-icon">{{item.title}}</span>
      </div>
      <div v-if="item.children" class="item-children">
        <detail-list :list="item.children"></detail-list>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailList',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  .list-item
    line-height: .6rem
    font-size: .3rem
    .item-title-icon
      position: relative
      width: .36rem
      height: .36rem
      top: .26rem
      left: .2rem
      background: url(http://s.qunarzz.com/piao/image/touch/sight/detail.png) 0 -.45rem no-repeat
      padding-left: .4rem
      background-size: .4rem 3rem
    .item-children
      padding-left: .3rem
</style>
